package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.YmtCouponConversionBatchRelation;
import com.ymttest.database.model.YmtCouponConversionBill;
import com.ymttest.utils.EnvSetup;

public class YmtCouponConversionBatchRelationWapper {
	SqlManager manage;

    public YmtCouponConversionBatchRelationWapper() {
        manage = new SqlManager("ymt" + EnvSetup.getEnv());
    }
    
    public List<YmtCouponConversionBatchRelation> selectByConversionBillId(int conversionBillId) {
        List<YmtCouponConversionBatchRelation> result = manage
                .getSelectResults(
                        "com.ymttest.database.mapping.YmtCouponConversionBatchRelationMapper.selectByConversionBillId",
                        conversionBillId);
        return result;
    }
    
    public void setCouponBatchCode(int conversionBillId, String couponBatchCode) {
    	Map m = new HashMap();
        m.put("conversionBillId", conversionBillId);
        m.put("couponBatchCode", couponBatchCode);
        
        manage
                .update(
                        "com.ymttest.database.mapping.YmtCouponConversionBatchRelationMapper.setCouponBatchCode",
                        conversionBillId);
        manage.commit();
    }
}
